﻿using System.ServiceModel;
using System.ServiceModel.Web;

namespace DotNetNuke.Modules._2DoTasks.Services
{
    /// <summary>
    /// Interface for the services provided for the dnn 2dotasks module
    /// </summary>
    [ServiceContract]
    public interface IDataService
    {
        #region "Project"

        [OperationContract]
        [WebGet(UriTemplate = "Project_GetByName/{projectName}?portalId={portalId}",
                        ResponseFormat = WebMessageFormat.Json)]
        string[] Project_GetByName(string projectName, int portalId);

        #endregion "Project"

        #region "Task"

        [OperationContract]
        [WebInvoke(
            Method = "POST",
            UriTemplate = "Task_ToggleComplete?taskId={taskId}&portalId={portalId}",
            ResponseFormat = WebMessageFormat.Json)]
        void Task_ToggleComplete(int taskId, int portalId);

        #region "Sub Task"

        [OperationContract]
        [WebInvoke(
            Method = "POST",
            UriTemplate = "TaskSubTask_ToggleComplete?taskId={taskId}&subTaskId={subTaskId}&portalId={portalId}",
            ResponseFormat = WebMessageFormat.Json)]
        void TaskSubTask_ToggleComplete(int taskId, int subTaskId, int portalId);

        [OperationContract]
        [WebInvoke(
            Method = "POST",
            UriTemplate = "TaskSubTask_UpdateOrder?taskId={taskId}&subTaskId={subTaskId}&portalId={portalId}&order={order}",
            ResponseFormat = WebMessageFormat.Json)]
        void TaskSubTask_UpdateOrder(int taskId, int subTaskId, int portalId, int order);

        #endregion "Sub Task"

        #endregion "Task"
    }
}